package com.example.flower_shop.service;

import com.example.flower_shop.entity.User;

import java.util.Optional;

public interface UserService extends BaseService<User, Long> {

    Optional<User> findByOpenId(String openId);

    User createOrUpdateByOpenId(String openId, String nickname, String avatarUrl, Integer gender);

    boolean existsByOpenId(String openId);

    Optional<User> findByPhone(String phone);

    User updatePhone(Long userId, String phone);

    User register(String username, String password, String phone);

    boolean existsByUsername(String username);

    boolean existsByPhone(String phone);

    Optional<User> findByUsername(String username);
}